function addLoadEvent(func) {
    let oldOnload = window.onload;
    if (typeof window.onload != 'function') {
        window.onload = func;
    } else {
        window.onload = function () {
            oldOnload();
            func();
        }
    }
}

addLoadEvent(picture);

// function ChooseOrganization() {
//     var li = document.getElementsByClassName("department");
//     var department = document.getElementsByClassName("bit-department");
//     for (var i = 0; i < 4; i++) {
//         li[i].onclick = function () {
//             // 全部设置成同一级别
//             for (i = 0; i < 4; i++) {
//                 department[i].style.zIndex = "0";
//             }
//             // 单独设置点击相应的内容的级别
//             this.department.style.zIndex = '1';
//         }
//         //li[i].department = department[i];
//     }
// }


function picture() {
    let bitzu = document.getElementsByClassName("zu");
    let bitkai = document.getElementsByClassName("kai");
    let bitnei = document.getElementsByClassName("nei");
    let bitgong = document.getElementsByClassName("gong");
    let picture1 = document.getElementsByClassName("picture1");
    let picture2 = document.getElementsByClassName("picture2");
    let picture3 = document.getElementsByClassName("picture3");
    let picture4 = document.getElementsByClassName("picture4");
    let zu = document.getElementsByClassName("bit-zu");
    let nei = document.getElementsByClassName("bit-nei");
    let kai = document.getElementsByClassName("bit-kai");
    let gong = document.getElementsByClassName("bie-gong");

    bitzu[0].onclick = function (e) {
        picture1[0].style.display = "none";
        picture2[0].style.display = "none";
        picture3[0].style.display = "none";
        picture4[0].style.display = "block";
        zu[0].style.display = "block";
        nei[0].style.display = "none";
        kai[0].style.display = "none";
        gong[0].style.display = "none";
        stopEvent(e);
    }

    bitnei[0].onclick = function (e) {
        picture1[0].style.display = "none";
        picture2[0].style.display = "block";
        picture3[0].style.display = "none";
        picture4[0].style.display = "none";
        zu[0].style.display = "none";
        nei[0].style.display = "block";
        kai[0].style.display = "none";
        gong[0].style.display = "none";
        stopEvent(e);
    }

    bitkai[0].onclick = function (e) {
        picture1[0].style.display = "none";
        picture2[0].style.display = "none";
        picture3[0].style.display = "block";
        picture4[0].style.display = "none";
        zu[0].style.display = "none";
        nei[0].style.display = "none";
        kai[0].style.display = "block";
        gong[0].style.display = "none";
        stopEvent(e);
    }

    bitgong[0].onclick = function (e) {
        picture1[0].style.display = "block";
        picture2[0].style.display = "none";
        picture3[0].style.display = "none";
        picture4[0].style.display = "none"; 
        zu[0].style.display = "none";
        nei[0].style.display = "none";
        kai[0].style.display = "none";
        gong[0].style.display = "block";
        stopEvent(e);
    }
}


function stopEvent(event) {
    let e = arguments.callee.arguments[0] || event;
    if (window.event) {
        e.cancelBubble = true;
        e.returnValue = false;
    } else if (e && e.stopPropagation) {
        e.stopPropagation();
        e.preventDefault();
    }
}